﻿using EPiServer;
using EPiServer.DynamicContent;
using SocialPack.modules.SocialPack.Widgets.Facebook;

namespace SocialPack.modules.SocialPack.DynamicContent.Facebook
{
    [DynamicContentPlugIn(
        DisplayName = "Facebook Like It",
        Description = "Displays Facebook Like It",
        ViewUrl = "~/modules/socialpack/dynamiccontent/facebook/likeit.ascx")]
    public partial class LikeIt : UserControlBase
    {
        public bool ShowFaces { get; set; }
        public int Width { get; set; }
        public bool ShowSendButton { get; set; }
        public Layout Layout { get; set; }
        public Action Action { get; set; }

        public string CountryCode { get; set; }

        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            this.LikeItControl.ShowFaces = this.ShowFaces;
            this.LikeItControl.Width = this.Width;
            this.LikeItControl.ShowSendButton = this.ShowSendButton;
            this.LikeItControl.Layout = this.Layout;
            this.LikeItControl.Action = this.Action;

            if (!string.IsNullOrWhiteSpace(this.CountryCode))
            {
                this.LikeItControl.CountryCode = this.CountryCode;
            }
        }
    }
}